package demo04;

/**
 * 装饰者模式
 * */
public class Test {
	public static void main(String[] args) {
		Beverage ba = new Espresso();//浓缩咖啡
		System.out.println(ba.getDescriPtion()+ba.cost()+"￥");
		System.out.println("----------分割线--------------");
		Beverage ba2 = new DarkRoast();//深度烘焙咖啡
		ba2 = new Soy(ba2);//用豆浆装饰
		ba2 = new Soy(ba2);//在来一遍
		ba2 = new Milk(ba2);//最后用牛奶来装饰
		System.out.println(ba2.getDescriPtion()+ba2.cost()+"￥");
		
		/*
		 浓缩咖啡:7.99￥
		----------分割线--------------
		深度烘焙咖啡:,豆浆,豆浆,奶昔16.39￥
		*/
	}

}
